package com.woniuxy.buyer.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;

import java.time.LocalDateTime;

/**
 * 积分流水实体
 */
@Data
@TableName("point_transactions")
public class PointTransaction {

    @TableId(type = IdType.AUTO)
    private Long id;

    private Long userId;

    private String type; // EARN, SPEND, REFUND

    private Integer amount;

    private Integer balanceBefore;

    private Integer balanceAfter;

    private String description;

    private Long relatedOrderId;

    private Long operatorId;

    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    // 非数据库字段
    @TableField(exist = false)
    private String username;

    @TableField(exist = false)
    private String operatorName;
}
